package org.bizming.web.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.log4j.PropertyConfigurator;

public class Log4jListener implements ServletContextListener {

	public void contextInitialized(ServletContextEvent sce) {
		String prefix = sce.getServletContext().getRealPath("/");
		String file = sce.getServletContext().getInitParameter(
				"log4j-init-file");
		if (file != null) {
			PropertyConfigurator.configure(prefix + file);
		}
	}

	public void contextDestroyed(ServletContextEvent sce) {

	}

}
